﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
    <link href="~/Content/Images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <title>登录页面</title>
    @*<link href="~/Content/Styles/us-framework.css" rel="stylesheet" />*@
    <script src="~/Content/Scripts/jquery/jquery-1.8.2.min.js"></script>
    <script src="~/Content/Scripts/us-framework.js"></script>
    <script src="~/Content/Scripts/jquery/jQuery.md5.js"></script>
    @*<link href="~/Content/Styles/learunui-login.css" rel="stylesheet" />*@
    <script src="~/Content/Scripts/cookie/jquery.cookie.js"></script>
    <link href="~/Content/Styles/zzsc.css" rel="stylesheet" />
    <link href="~/Content/Styles/main.css" rel="stylesheet" />
    <script>
        /*
        检查浏览器是否支持
        */
        var isIE = !!window.ActiveXObject;
        var isIE6 = isIE && !window.XMLHttpRequest;
        if (isIE6) {
            window.location.href = "../Error/Browser";
        }
        //回车键
        document.onkeydown = function (e) {
            if (!e) e = window.event; //火狐中是 window.event
            if ((e.keyCode || e.which) == 13) {
                var btlogin = document.getElementById("btlogin");
                btlogin.focus();
                btlogin.click();
            }
        }
        $(function () {
            $("#btlogin").click(function () {
                var txtaccount = $("#txtaccount").val();
                var txtpassword = $("#txtpassword").val();
                if (txtaccount == "") {
                    $("#txtaccount").focus();
                    formMessage('登录账户不能为空', 'warning');
                    return false;
                } else if (txtpassword == "") {
                    $("#txtpassword").focus();
                    formMessage('登录密码不能为空', 'warning');
                    return false;
                } else {
                    formMessage('正在登录...', 'succeed');
                    window.setTimeout(function () {
                        var postData = {
                            Account: escape(txtaccount),
                            Password: escape($.md5(txtpassword))
                        }
                        getAjax('/Login/CheckLogin', postData, function (rs) {
                            if (parseInt(rs) == -1) {
                                $("#txtaccount").focus();
                                formMessage('登录账户不存在', 'error');
                            } else if (parseInt(rs) == 2) {
                                $("#txtaccount").focus();
                                formMessage('登录账户被系统锁定', 'error');
                            } else if (parseInt(rs) == 4) {
                                $("#txtaccount").focus();
                                $("#txtpassword").val("");
                                formMessage('登录密码错误', 'error');
                            } else if (parseInt(rs) == 3) {
                                formMessage('登录验证成功,正在跳转首页', 'succeed');
                                setInterval(Load, 1000);
                            } else {
                                alert(rs);
                            }
                        });
                    }, 500);
                }
            })
        })
    //登录加载
    function Load() {
        var Index = $.cookie('UItheme');
        if (Index) {
            window.location.href = '@Url.Content("~/Home/")' + Index;
        } else {
            window.location.href = '@Url.Content("~/Home/AccordionIndex")';
        }
        return false;
    }
    //提示信息
    function formMessage(msg, type) {
        $('.form-message').html('');
        $('.form-message').append('<div class="form-' + type + '-text">' + msg + '</div>');
    }
    </script>
</head>

<body autocomplete="off">
    <div class="login">
        <div class="login_main">
            <div class="from">
                <div class="logo">
                    <img src="~/Content/Images/login/logo.png" />
                </div>
                <div class="title">
                    <span style="font-size:30px">嘉联益智能核销系统</span>
                </div>
                <div class="row">
                    <div class="row_lf">
                        <img src="~/Content/Images/login/login_icon1.png" />
                    </div>
                    <div class="row_rt">
                        <input type="text" placeholder="企业代码" />
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">
                        <img src="~/Content/Images/login/login_icon2.png" />
                    </div>
                    <div class="row_rt">
                        <input type="text" placeholder="账号" id="txtaccount" name="txtaccount" autocomplete="off" />
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">
                        <img src="~/Content/Images/login/login_icon3.png" />
                    </div>
                    <div class="row_rt">
                        <input type="password" placeholder="密码" id="txtpassword" name="txtpassword" autocomplete="new-password" />
                    </div>
                </div>
                @*<div class="wjmm">忘记密码？</div>*@
                <button class="btn" id="btlogin">登录</button>
            </div>
        </div>
    </div>
    @*<div class="copyright" style="text-align:left">
        嘉联益信息科技有限公司
        <br />
        官方网站：http://www.xxxxxx.com/
    </div>*@
</body>
</html>
